<?php

  session_start();
  require_once 'Task.class.php';
  require_once 'Test.class.php';
  $test = new Test();
  $test->parse( $test_filename );

  $answers = array( );
  foreach ( $_SESSION['ids'] as $id ) {
      $answers[$id] = array( );
  }
  if ( $_REQUEST['answer'] )
      foreach ( $_REQUEST['answer'] as $id => $val ) {
          foreach ( $val as $answer_id => $on ) {
              $answers[$id][] = $answer_id;
          }
      }
  $test->setAnswers( $answers );
?>
